import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home/Home'
import Search from '@/views/Search/Search'
import Play from '@/views/Play/Play'
import Layout from '@/views/Layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/layout',
    component: Layout,
    children: [{
      path: '/home',
      component: Home
    },
    {
      path: '/search',
      component: Search
    }]
  },
  {
    path: '/play/:id',
    component: Play
  }
]

const router = new VueRouter({
  routes
})

export default router
